﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UtilityTest
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void GetLocalMachineValueTestMethod1()
        {
            string regvalue = Utility.RegistoryManager.GetLocalMachineValue(@"Software\Microsoft\MSBuild\ToolsVersions\4.0", "");
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void GetLocalMachineValueTestMethod2()
        {
            string regvalue = Utility.RegistoryManager.GetLocalMachineValue("", "MSBuildToolsPath");
        }

        [TestMethod]
        public void GetLocalMachineValueTestMethod3()
        {
            string regvalue = Utility.RegistoryManager.GetLocalMachineValue(@"Software\Microsoft\MSBuild\ToolsVersions\4.0", "hoge");
            Assert.IsNull(regvalue);
        }

        [TestMethod]
        public void GetLocalMachineValueTestMethod4()
        {
            string regvalue = Utility.RegistoryManager.GetLocalMachineValue(@"hoge", "hoge");
            Assert.IsNull(regvalue);
        }

        [TestMethod]
        public void GetLocalMachineValueTestMethod5()
        {
            string regvalue = Utility.RegistoryManager.GetLocalMachineValue(@"Software\Microsoft\MSBuild\ToolsVersions\4.0", "MSBuildToolsPath");
            Assert.AreEqual(@"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\", regvalue);
        }

    }
}
